/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/kexec.h>
#include <asm/sysreg.h>
#include <asm/virt.h>
#include <asm/angel_core.h>

.text
.pushsection    .idmap.text, "awx"
SYM_CODE_START(angel_loop)
	mrs		x12, sctlr_el1
	mov_q	x13, SCTLR_ELx_FLAGS
	bic		x12, x12, x13
	pre_disable_mmu_workaround
	msr		sctlr_el1, x12      /* disable mmu */
	isb

	ldr		x3, [x1, #0x18]
	mov		sp, x3
	dsb		sy
	br		x2
SYM_CODE_END(angel_loop)

.popsection
